<?
session_start();
require_once("../config/dbconn.php");

//是否关闭了系统
if($glo_sysclose==1){
	die($glo_closememo);
}

if($action=='userlogin'){
	$msg='';
	if(trim($username)=='') $msg.="请输入用户名\\n";
	if(trim($password)=='') $msg.="请输入密码\\n";
	if(trim($verifycode)=='') $msg.="请输入验证码\\n";
	else{
		if ($_SESSION['lgnrandcode2']!=trim($verifycode))$msg.="验证码错误\\n";
	}
	if ($msg!=''){
		echo "<script>alert('$msg');history.back();</script>";exit();
	}
	$sql="select * from {$db_prefix}users where username='".trim($username)."'";
	$rs=$db->get_one($sql);
	if (!$rs['id']){
		$msg.="用户名或密码错误\\n";
	}else{
		if (authcode($rs['pwd'],"DECODE")!=$password) $msg.="用户名或密码错误\\n";
	}
	if ($msg!=''){
		echo "<script>alert('$msg');history.back();</script>";exit();
	}
	$_SESSION['sys_userid']=$rs['id'];$_SESSION['sys_username']=$rs['username'];
	
	echo "<script>location.href='index.php';</script>";exit();
}
?>
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<TITLE>会员登陆</TITLE>
<NOSCRIPT><iframe src="*.html"></iframe></NOSCRIPT>
<link rel="stylesheet" href="css/style2.css" type="text/css">
<META content="MSHTML 6.00.2900.2180" name=GENERATOR></HEAD>
<STYLE type=text/css>.STYLE1 {
	COLOR: #333333
}
BODY {
	MARGIN-LEFT: 0px; MARGIN-RIGHT: 0px
}
.STYLE2 {
	FONT-SIZE: 16px
}
.STYLE4 {
	FONT-WEIGHT: bold; COLOR: #ffffff
}
.rest {
	BORDER-RIGHT: medium none; BACKGROUND-POSITION: center 50%; BORDER-TOP: medium none; FONT-SIZE: 9pt; BACKGROUND-IMAGE: url(images/reset.gif); BORDER-LEFT: medium none; WIDTH: 50px; BORDER-BOTTOM: medium none; HEIGHT: 22px; TEXT-ALIGN: center; BACKGROUND-: medium none
}
.bg2 {
     background:transparent url("imgaes/1.jpg") no-repeat;width:100%
}
.subm {
	BORDER-RIGHT: medium none; BACKGROUND-POSITION: center 50%; BORDER-TOP: medium none; FONT-SIZE: 9pt; BACKGROUND-IMAGE: url(images/submit.gif); BORDER-LEFT: medium none; WIDTH: 50px; BORDER-BOTTOM: medium none; HEIGHT: 22px; TEXT-ALIGN: center; BACKGROUND-: medium none
}
</STYLE>

<BODY leftMargin=0 marginwidth="0" onmouseover="self.status='Welcome to Our website!';return true" onselectstart="return false">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tbody>
  <tr>
    <td>
	<div align="center"><img src="images/1.jpg" width="100%"></div></td>
    </tr>	
  <TR><form name="userlogin" method="post" action="">
    <TD vAlign=center align=right background=images/menu.jpg height=31>
	
      <TABLE cellSpacing=0 cellPadding=0 align=center border=0>
        <TBODY>
        <TR>
          <TD class=menuid style="WIDTH: 78px">用户ID:</TD>
          <TD align=left height=20><INPUT name=username  style="color: #ffffff; border:1px ffffff solid;background-color:transparent;background-image: url('gif1/')"></TD>
          <TD class=menuid>　 
            密 码:</TD>
          <TD class=zgl3 align=left><INPUT class=inputbox id=password 
            type=password name=password style="color: #FFffff; border:1px ffffff solid;background-color:transparent;background-image: url('gif1/')"></TD>
          <TD class=menuid>　
            验证码:</TD>
          <TD class=zgl3 align=left><INPUT class=inputbox maxLength=6 size=4 
            name=verifycode style="color: #FFffff; border:1px ffffff solid;background-color:transparent;background-image: url('gif1/')"> <img style="cursor:pointer" title="刷新验证码" id="refresh2" border='0' src='lgncode1.php'
onclick="document.getElementById('refresh2').src='lgncode1.php?t='+Math.random()"/> &nbsp;&nbsp;</TD>
          <TD align=left>　 <INPUT class=subm type=submit value=" " name=Submit><input type="hidden" name="action" value="userlogin"> 
          </TD></TR></TBODY></TABLE></TD></FORM></TR>

  </tbody>
</table>
</BODY></HTML>                                                                                              
                                                                                              
